<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" href="/Public/js/datepicker/datepicker.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">
		
		<link rel="stylesheet" type="text/css" href="/Public/js/select2/select2.css" media="all"/>

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>
		
		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>

        <script type="text/javascript" src="/Public/crm/js/index.js"></script>

        <script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/select2.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/jquery.core.js"></script>

	</head>

<body>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.all.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/moment.min.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.en.js"></script>

    <div class="fd-right-main">

        

    <div class="feeldesk-form pd0 feelcrm-form">

		<form id="web_setting" action="<?php echo U('index');?>" method="post" class="layui-form">

        <div class="layui-tab">

            <ul class="layui-tab-title">

                <li class="layui-this"><?php echo L('BASIC_PARAMETER_SETTING');?></li>

				<div class="form-submit">

					<a href="javascript:" class="layui-btn layui-btn-normal submitForm"><?php echo l('SUBMIT');?></a>

				</div>

            </ul>

            <div class="layui-tab-content form-content">

                <div class="layui-tab-item layui-show">

                        <div class="form-item">

                            <!--<div class="layui-form-item">

                                <label class="layui-form-label left">订单编码前缀</label>

                                <div class="layui-input-inline mr0 wauto">

                                    <input type="text" name="crmsite[orderCode]" value="<?php echo ((isset($crmsite["orderCode"]) && ($crmsite["orderCode"] !== ""))?($crmsite["orderCode"]):'O-'); ?>"  placeholder="" class="layui-input w100 mr20">

									<input type="checkbox" name="rOrderCode" lay-skin="primary" value="1" class="layui-input"  title="<?php echo L('REPLACE_ORIGINAL_PREFIX');?>"/>

                                </div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="可修改商机编号的前缀"></i>

                            </div>-->

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CONTRACT_CODE_PREFIX');?></label>

                                <div class="layui-input-inline mr0 wauto">

                                    <input type="text" name="crmsite[contractCode]" value="<?php echo ((isset($crmsite["contractCode"]) && ($crmsite["contractCode"] !== ""))?($crmsite["contractCode"]):'H-'); ?>"  placeholder="" class="layui-input w100 mr20">

									<input type="checkbox" name="rContractCode" lay-skin="primary" value="1" class="layui-input"  title="<?php echo L('REPLACE_ORIGINAL_PREFIX');?>"/>

                                </div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="<?php echo L('CONTRACT_PREFIX_REMARK');?>"></i>

                            </div>

							<div class="layui-form-item">

								<label class="layui-form-label left"><?php echo L('CLUE_CODE_PREFIX');?></label>

								<div class="layui-input-inline mr0 wauto">

									<input type="text" name="crmsite[clueCode]" value="<?php echo ((isset($crmsite["clueCode"]) && ($crmsite["clueCode"] !== ""))?($crmsite["clueCode"]):'X-'); ?>"  placeholder="" class="layui-input w100 mr20">

									<input type="checkbox" name="rClueCode" lay-skin="primary" value="1" class="layui-input"  title="<?php echo L('REPLACE_ORIGINAL_PREFIX');?>"/>

								</div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="<?php echo L('CLUE_PREFIX_REMARK');?>"></i>

							</div>

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CUSTOMER_CODE_PREFIX');?></label>

                                <div class="layui-input-inline mr0 wauto">

                                    <input type="text" name="crmsite[customerCode]" value="<?php echo ((isset($crmsite["customerCode"]) && ($crmsite["customerCode"] !== ""))?($crmsite["customerCode"]):'C-'); ?>"  placeholder="" class="layui-input w100 mr20">

									<input type="checkbox" name="rCustomerCode" lay-skin="primary" value="1" class="layui-input"  title="<?php echo L('REPLACE_ORIGINAL_PREFIX');?>"/>

                                </div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="<?php echo L('CUSTOMER_PREFIX_REMARK');?>"></i>

                            </div>

							<div class="layui-form-item">

								<label class="layui-form-label left"><?php echo L('OPPORTUNITY_CODE_PREFIX');?></label>

								<div class="layui-input-inline mr0 wauto">

									<input type="text" name="crmsite[opportunityCode]" value="<?php echo ((isset($crmsite["opportunityCode"]) && ($crmsite["opportunityCode"] !== ""))?($crmsite["opportunityCode"]):'S-'); ?>"  placeholder="" class="layui-input w100 mr20">

									<input type="checkbox" name="rOpportunityCode" lay-skin="primary" value="1" class="layui-input"  title="<?php echo L('REPLACE_ORIGINAL_PREFIX');?>"/>

								</div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="<?php echo L('OPPORTUNITY_PREFIX_REMARK');?>"></i>

							</div>

							<div class="layui-form-item">

                               <!-- <label class="layui-form-label left"><?php echo L('WHETHER_OPEN_DISTRIBUTOR');?></label>-->
                                <label class="layui-form-label left"><?php echo L('ENABLE_PARTNER');?></label>

                                <div class="layui-input-inline">

									<input type="radio" name="crmsite[customerReseller]" value="1" title="<?php echo L('YES');?>" <?php if(($crmsite["customerReseller"]) == "1"): ?>checked<?php endif; ?> >

									<input type="radio" name="crmsite[customerReseller]" value="-1" title="<?php echo L('NO');?>" <?php if(empty($crmsite["customerReseller"])): ?>checked<?php endif; ?> <?php if(($crmsite["customerReseller"]) == "-1"): ?>checked<?php endif; ?> >

                                </div>

                            </div>

							<div class="layui-form-item hidden">

								<label class="layui-form-label left"><?php echo L('PROPORTION_COMPUTING_INDUSTRY');?></label>

								<div class="layui-input-inline mar20" style="width:250px;" id="shipment_trade"></div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="<?php echo L('PROPORTION_COMPUTING_REMARK');?>"></i>

								<script type="text/javascript">

									var follow_customer = <?php echo ($trades); ?>;

									var shipment_trade = '<?php echo ($crmsite["shipment_trade"]); ?>';

									layui.config({
										base : '/Public/js/layui/extends/'
									}).extend({
										selectM: 'selectM'
									}).use(['selectM'],function()
									{
										layui.selectM(
										{
											elem: '#shipment_trade',
											data: follow_customer,
											selected: shipment_trade.split(','),
											width:'60%',
											max:100
										});
									})

								</script>

							</div>

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('WORKING_HOURS_CONFIGURATION');?></label>

                                <div class="layui-input-inline">

									<span class="">

										<input type="text" name="crmsite[workStartTime]" value="<?php echo ((isset($crmsite["workStartTime"]) && ($crmsite["workStartTime"] !== ""))?($crmsite["workStartTime"]):'09:00:00'); ?>" class="layui-input w100" id="workStartTime" placeholder="HH:mm:ss"> -- <input type="text" name="crmsite[workEndTime]" value="<?php echo ((isset($crmsite["workEndTime"]) && ($crmsite["workEndTime"] !== ""))?($crmsite["workEndTime"]):'18:00:00'); ?>" class="layui-input w100" id="workEndTime" placeholder="HH:mm:ss">

									</span>

                                </div>

                            </div>

							<script>

								layui.use('laydate', function()
								{
									var laydate = layui.laydate;

									laydate.render({
										elem: '#workStartTime',
										type: 'time'
									});

									laydate.render({
										elem: '#workEndTime',
										type: 'time'
									});
								})

							</script>

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CUSTOMER_NOT_FOLLOW_UP_NOTICE');?></label>

                                <div class="layui-input-inline">

									<span class=""><input type="number" name="crmsite[noFollowup]" value="<?php echo ((isset($crmsite["noFollowup"]) && ($crmsite["noFollowup"] !== ""))?($crmsite["noFollowup"]):'3'); ?>"  placeholder="" class="layui-input w100"/> <?php echo L('DAYS_HAVE_NOT_FOLLOWED_UP');?></span>

                                </div>

                            </div>

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CUSTOMER_NON_REVISIT_NOTICE');?></label>

                                <div class="layui-input-inline">

									<span class=""><input type="number" name="crmsite[noReturnvisit]" value="<?php echo ((isset($crmsite["noReturnvisit"]) && ($crmsite["noReturnvisit"] !== ""))?($crmsite["noReturnvisit"]):'30'); ?>"  placeholder="" class="layui-input w100"/> <?php echo L('DAYS_HAVE_NOT_REVISIT');?></span>

                                </div>

                            </div>

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CONTRACT_EXPIRATION_REMINDER');?></label>

                                <div class="layui-input-inline">

									<span class=""><?php echo L('ADVANCE');?> <input type="number" name="crmsite[contractExpire]" value="<?php echo ((isset($crmsite["contractExpire"]) && ($crmsite["contractExpire"] !== ""))?($crmsite["contractExpire"]):'3'); ?>"  placeholder="" class="layui-input w100"/> <?php echo L('DAYS_REMINDER');?></span>

                                </div>

                            </div>

                            <div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CUSTOMER_PAYBACK_CYCLE');?></label>

                                <div class="layui-input-inline">

                                    <input type="radio" name="crmsite[custRecover]" lay-filter="custRecover" value="-1" title="<?php echo L('DISABLE');?>" checked <?php if(($crmsite["custRecover"]) == "-1"): ?>checked<?php endif; ?>>

									<input type="radio" name="crmsite[custRecover]" lay-filter="custRecover" value="1" title="<?php echo L('ENABLE');?>" <?php if(($crmsite["custRecover"]) == "1"): ?>checked<?php endif; ?>>

									<span class="RecoverCondition <?php if(($crmsite["custRecover"]) != "1"): ?>hidden<?php endif; ?>">
										<input type="number" name="crmsite[noFollowupDay]" value="<?php echo ((isset($crmsite["noFollowupDay"]) && ($crmsite["noFollowupDay"] !== ""))?($crmsite["noFollowupDay"]):'7'); ?>"  placeholder="" class="layui-input w50">
										<?php echo L('DAYS_NOT_FOLLOWED_UP_OR');?>
										<input type="number" name="crmsite[noSignOrderDay]" value="<?php echo ((isset($crmsite["noSignOrderDay"]) && ($crmsite["noSignOrderDay"] !== ""))?($crmsite["noSignOrderDay"]):'60'); ?>"  placeholder="" class="layui-input w50">
										<?php echo L('DAYS_NOT_SIGNED');?>
									</span>

                                </div>

                            </div>

                            <div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CUSTOMER_LIMIT');?></label>

                                <div class="layui-input-inline">

                                    <input type="radio" name="crmsite[custLimit]" value="-1" title="<?php echo L('DISABLE');?>" checked <?php if(($crmsite["custLimit"]) == "-1"): ?>checked<?php endif; ?>>

									<input type="radio" name="crmsite[custLimit]" value="1" title="<?php echo L('ENABLE');?>" <?php if(($crmsite["custLimit"]) == "1"): ?>checked<?php endif; ?>>

                                </div>

                            </div>

                            <div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('CUSTOMER_COLLECTION_CYCLE');?></label>

                                <div class="layui-input-inline">

									<div class="fl w100">

										<select name="crmsite[custDrawT]">

											<option value="day" <?php if(($crmsite["custDrawT"]) == "day"): ?>selected<?php endif; ?>><?php echo L('THAT_DAY');?></option>
											<option value="week" <?php if(($crmsite["custDrawT"]) == "week"): ?>selected<?php endif; ?>><?php echo L('WITHIN_A_WEEK');?></option>
											<option value="month" <?php if(($crmsite["custDrawT"]) == "month"): ?>selected<?php endif; ?>><?php echo L('WITHIN_ONE_MONTH');?></option>

										</select>

								   </div>
								   &nbsp;<?php echo L('RESTRICTED_COLLECTION');?> <input type="number" name="crmsite[custDrawNum]" value="<?php echo ($crmsite["custDrawNum"]); ?>"  placeholder="" class="layui-input w100">

                                </div>

                            </div>

							<div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('AREA_SCOPE');?></label>

                                <div class="layui-input-inline">

									<input type="radio" name="crmsite[regionType]" value="world" title="<?php echo L('GLOBAL');?>" checked <?php if(($crmsite["regionType"]) == "world"): ?>checked<?php endif; ?> lay-filter="regionType">

									<input type="radio" name="crmsite[regionType]" value="china" title="<?php echo L('CHINA');?>" <?php if(($crmsite["regionType"]) == "china"): ?>checked<?php endif; ?> lay-filter="regionType">

                                </div>

                            </div>

                            <div class="layui-form-item">

                                <label class="layui-form-label left"><?php echo L('DEFAULT_REGION');?></label>

								<div class="layui-input-inline w150 layui-form region-item <?php if(($crmsite["regionType"]) != "world"): ?>hidden<?php endif; ?>" lay-filter="country">

									<select class="regionCountry" name="crmsite[defaultCountry]" lay-filter="select-country" id="country" lay-ignore>

										<option value=""><?php echo L('PLEASE_SELECT');?></option>

										<?php if(is_array($country)): $i = 0; $__LIST__ = $country;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vc): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vc["code"]); ?>" <?php if(($crmsite["regionType"]) != "world"): if(($vc["code"]) == "1"): ?>selected<?php endif; else: if(($crmsite["defaultCountry"]) == $vc["code"]): ?>selected<?php endif; endif; ?>><?php echo ($vc["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

									</select>

								</div>

                                <div class="layui-input-inline w150 <?php if(empty($crmsite["defaultProv"])): ?>hidden<?php endif; ?> layui-form region-item" lay-filter="province">

									<select class="regionProv" name="crmsite[defaultProv]" lay-filter="select-province" id="province" lay-ignore>

										<option value=""><?php echo L('PLEASE_SELECT');?></option>

										<?php if(!empty($crmsite["defaultProv"])): if(is_array($province)): $i = 0; $__LIST__ = $province;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vc): $mod = ($i % 2 );++$i;?><option c-value="<?php echo ($vc["country_code"]); ?>" value="<?php echo ($vc["code"]); ?>" <?php if(($crmsite["defaultProv"]) == $vc["code"]): ?>selected<?php endif; ?>><?php echo ($vc["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; endif; ?>

									</select>

								</div>

								<div class="layui-input-inline w150 <?php if(empty($crmsite["defaultCity"])): ?>hidden<?php endif; ?> layui-form region-item" lay-filter="city">

									<select class="regionCity" name="crmsite[defaultCity]"  lay-filter="select-city" id="city" lay-ignore>

										<option value=""><?php echo L('PLEASE_SELECT');?></option>

										<?php if(!empty($crmsite["defaultCity"])): if(is_array($city)): $i = 0; $__LIST__ = $city;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vc): $mod = ($i % 2 );++$i;?><option c-value="<?php echo ($vc["country_code"]); ?>" p-value="<?php echo ($vc["province_code"]); ?>" value="<?php echo ($vc["code"]); ?>" <?php if(($crmsite["defaultCity"]) == $vc["code"]): ?>selected<?php endif; ?>><?php echo ($vc["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; endif; ?>

									</select>

								</div>

								<div class="layui-input-inline w150 <?php if(empty($crmsite["defaultArea"])): ?>hidden<?php endif; ?> layui-form region-item" lay-filter="area">

									<select class="regionArea" name="crmsite[defaultArea]"  lay-filter="select-area" id="area" lay-ignore>

										<option value=""><?php echo L('PLEASE_SELECT');?></option>

										<?php if(!empty($crmsite["defaultArea"])): if(is_array($area)): $i = 0; $__LIST__ = $area;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vc): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vc["code"]); ?>" <?php if(($crmsite["defaultArea"]) == $vc["code"]): ?>selected<?php endif; ?>><?php echo ($vc["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; endif; ?>

									</select>

								</div>

								<i class="layui-icon layui-icon-about intro-icon fl blue8" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

                            </div>

							<script type="text/javascript">

								layui.use('form',function()
								{
									var form = layui.form;

									form.on('radio(regionType)',function(data)
									{
										var value = data.value;

										if(value == 'world')
										{
											$('#country').parents('.region-item').slideDown('fast');

											$('#province').html('<option value=""><?php echo L('SELECT_CITY');?></option>').parents('.region-item').slideUp('fast');

											$('#city').html('<option value=""><?php echo L('SELECT_CITY');?></option>').parents('.region-item').slideUp('fast');

											$('#area').html('<option value=""><?php echo L('SELECT_AREA');?></option>').parents('.region-item').slideUp('fast');

											$("#country").select2();

											selectProvince('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
										}
										else
										{
											$("#country option[value='1']").attr("selected", true);

											$('#country').parents('.region-item').slideUp('fast');

											selectProvince('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
										}
									})

								})

								$("#country").select2();

								$("#province").select2();

								$("#city").select2();

								$("#area").select2();

								if($("#country<?php echo $reg; ?>").val() && !$("#province<?php echo $reg; ?>").val())
								{
									selectProvince('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
								}

								if($("#province<?php echo $reg; ?>").val() && !$("#city<?php echo $reg; ?>").val())
								{
									selectCity('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
								}

								if($("#city<?php echo $reg; ?>").val() && !$("#area<?php echo $reg; ?>").val())
								{
									selectArea('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
								}

								$("#country<?php echo $reg; ?>").change(function()
								{
									selectProvince('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
								})

								$("#province<?php echo $reg; ?>").change(function()
								{
									selectCity('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
								})

								$("#city<?php echo $reg; ?>").change(function()
								{
									selectArea('<?php echo $reg; ?>',"<?php echo U('AjaxRequest/getRegion');?>");
								})

							</script>

                        </div>

                </div>

            </div>

        </div>

        </form>

    </div>

	<script>

	</script>

    <script type="text/javascript" src="/Public/js/submitform.js"></script>

    

	</body>

</html>

<!-- 底部结束 -->





    </div>

    </body>

</html>